Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 6 - Printing Resources / Printing Resources Reference
Resources Used Only in Printer Drivers


The Look ('look') Resource

The look ('look') resource specifies the kinds of communications that a driver uses. It contains a list of entries, each of which can be used when the user creates a desktop printer with the Chooser. The values in the look resource are also used for printer sharing; you must include a communications resource for each entry in the look resource to make printer sharing work properly. Figure 6-10 shows the structure of a look resource.

Figure 6-10 The look resource

The look resource consists of a default indicator, a count, and one or more "looker" entries.

Each looker entry tells QuickDraw GX about one kind of communications that the driver can perform and includes the following fields:

Table 6-13 shows the constants that you can use to specify the kind of connection that a driver uses.
Table 6-13 Flag constants for the look resource
ConstantValueExplanation
isAppleTalk1This entry specifies an AppleTalk Printer Access Protocol (PAP) connection that requires a name-binding proctocol (NBP) lookup.
iconCells2This entry specifies that the Chooser displays icons in its list rather than names.
isPrinterShare4This entry specifies an Apple PrinterShare connection to a server.

The look resource ID needs to be the constant -4096. Listing 6-9 shows an example of a look resource.

Listing 6-9 An example of a look resource

resource 'look' (-4096, sysHeap, purgeable)
{
   2,                /* use the 2nd entry in list as default */
   {
   "AppleTalk",   -4096,   isAppleTalk,      "ImageWriter";
   "Serial",      -4095,   iconCells,        "Modem Port";
   "Servers",     -4094,   isAppleTalk+isPrinterShare,
                                             "ImageWriterIIIS";
   };
};
This is a look resource for an ImageWriter II printer, which supports PAP (the Printer Access Protocol used in AppleTalk), serial, and PrinterShare communications interfaces. The communications resource that defines the AppleTalk interface has resource ID -4096, the communications resource for the serial interface has resource ID -4095, and the communications resource for the PrinterShare interface has resource ID -4094. The default connection type is serial, the Chooser uses icons for choosing the serial connection port, and the default icon that would be selected by the Chooser is the "Modem Port" icon.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help